-
Notifications
You must be signed in to change notification settings - Fork 599
Demonstrate exceptions for goto &NAME #23819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: blead
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see what this has to do with #23811.
It looks like you're trying to test the Can't goto subroutine from an eval-block
error, but we already have a test for that (line 205).
The goto &{ ... }
and goto &$foo
syntax variants are already exercised by lines 345 and 260 in this file.
# GH 23811 goto &NAME where block evaluates to coderef | ||
{ | ||
local $@; | ||
my $hw = 'hello world'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is $hw
for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
$hw
for?
The same string is used at lines 382, 391 and 400; hence, store in a variable.
t/op/goto-sub.t
Outdated
like($@, qr/^Can't goto subroutine from an eval-block/, | ||
"Can't goto subroutine (block which evaluates to coderef) from an eval block"); | ||
|
||
undef $@; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undef $@
is redundant before eval
. Every eval
resets $@
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in two locations in next push; thanks.
Provide simple examples of goto &NAME syntax used incorrectly. Addresses: GH Perl#23811 Remove two superfluous statements, per review by @mauke.
de676ae
to
d0a88a3
Compare
Provide simple examples of goto &NAME syntax used incorrectly.
Fixes: GH #23811